<template>
  <div class="assign-order">
    <ContentWrap>
      <FormContainer :column="4">
        <el-form
          ref="formOrder"
          :model="formData"
          :rules="formRules"
          label-width="90px"
        >
          <el-form-item prop="createPerson" label="创建人">
            <el-select v-model="formData.createPerson" filterable clearable>
              <el-option :value="1" label="测试" />
            </el-select>
          </el-form-item>
          <el-form-item prop="contacts" label="联系人">
            <el-input v-model="formData.contacts" />
          </el-form-item>
          <el-form-item prop="contactsTel" label="联系电话">
            <el-input v-model="formData.contactsTel" />
          </el-form-item>
          <el-form-item prop="onlineID" label="线上ID">
            <el-input v-model="formData.onlineID" />
          </el-form-item>
          <el-form-item prop="orderCode" label="平台订单号">
            <el-input v-model="formData.orderCode" />
          </el-form-item>
          <el-form-item prop="createTime" label="创建时间">
            <el-date-picker
              v-model="formData.createTime"
              type="datetime"
              opt
            />
          </el-form-item>
          <el-form-item>
            <Button type="primary">查询</Button>
          </el-form-item>
        </el-form>
      </FormContainer>
      <table-box ref="table" no-request :table-config="tableConfig" />
      <div class="button-container">
        <InfoImport @refresh="loadTableData" />
        <DispachList text="批量派单" title="批量派单" />
        <Button type="danger">批量删除</Button>
      </div>
    </ContentWrap>
  </div>
</template>
<script>
import ContentWrap from '@/components/ContentWrap'
import Button from '@/components/Button'
import InfoImport from './components/infoImport'
import DispachList from '../components/DispachList'
import FormContainer from '@/components/FormContainer'
export default {
  name: 'AssignOrder',
  components: {
    ContentWrap,
    Button,
    FormContainer,
    InfoImport,
    DispachList
  },
  data() {
    return {
      formData: {
        createPerson: '', // 创建人
        contacts: '', // 联系人
        contactsTel: '', // 联系电话
        onlineID: '', // 线上id
        orderCode: '', // 平台订单号
        createTime: [] // 创建时间
      },
      formRules: {},
      tableConfig: {
        interfacePath: '/api/UserMng/GetConsumerUser',
        pageFlag: false,
        hideFuncBar: true,
        // 表格字段动态配置
        setting: [
          {
            type: 'selection'
          },
          {
            label: '序号',
            type: 'index'
          },
          {
            prop: 'workOrderCode',
            label: '平台订单号'
          },
          {
            prop: 'contacts',
            label: '联系人'
          },
          {
            prop: 'contactsTel',
            label: '联系电话'
          },
          {
            prop: '产品类型',
            label: '产品类型'
          },
          {
            prop: 'businessType2',
            label: '功能空间'
          },
          {
            prop: 'workOrderStaus',
            label: '产品品类'
          },
          {
            prop: 'workOrderProgress',
            label: '产品型号'
          },
          {
            prop: 'respDepartment',
            label: '来电明细'
          },
          {
            prop: '客服意见',
            label: '客服意见'
          },
          {
            prop: 'dealer',
            label: '省'
          },
          {
            prop: 'offlineShop',
            label: '市'
          },
          {
            prop: 'disposePerson',
            label: '区/县'
          },
          {
            prop: 'createTime',
            label: '街道'
          },
          {
            prop: '详细地址',
            label: '街道'
          },
          {
            prop: '办事处',
            label: '办事处'
          },
          {
            prop: 'createTime',
            label: '服务商'
          },
          {
            prop: 'createTime',
            label: '门店'
          },
          {
            prop: '',
            label: '导入时间'
          },
          {
            prop: '',
            label: '信息状态'
          },
          {
            label: '操作',
            // fixed: 'right',
            // FIXME:根据情况决定是否使用 render
            // ../components/Upload
            button: [
              {
                name: '上传附件',
                clickFun: () => {
                  console.log('上传附件')
                }
              },
              {
                name: '派单',
                clickFun: () => {
                  console.log('派单')
                }
              },
              {
                name: '删除',
                clickFun: () => {
                  console.log('删除')
                }
              }
            ]
          }
        ]
      }
    }
  },
  methods: {
    // 手动加载数据
    loadTableData() {
      this.$refs.table.initTableData()
    }
  }
}
</script>
<style lang="scss" scoped></style>
